package com.burstly.lib.component.networkcomponent.burstly.html.mraid;

import com.burstly.lib.util.LoggerExt;
import com.burstly.lib.util.Utils;
import com.burstly.lib.util.calendar.CalendarEvent;
import com.burstly.lib.util.calendar.CalendarEventsHandler;
import com.burstly.lib.util.calendar.CalendarEventsHandler.IEventsHandlerCallback;

class AddCalendarEvent extends MraidEvent
  implements CalendarEventsHandler.IEventsHandlerCallback
{
  static final int EVENT_ID = 8;
  private static final LoggerExt LOG = LoggerExt.getInstance();
  private static final String TAG = AddCalendarEvent.class.getSimpleName();
  private CalendarEventsHandler mEventsHandler;
  private MraidView mView;

  public void addedSuccessfully()
  {
  }

  protected void cleanUp()
  {
    super.cleanUp();
    this.mEventsHandler = null;
    this.mView = null;
  }

  public void errorOccured(String paramString)
  {
    LOG.logWarning(TAG, paramString, new Object[0]);
    this.mView.fireErrorEvent("createCalendarEvent", paramString);
  }

  void fireEvent(MraidView paramMraidView, Object[] paramArrayOfObject)
  {
    if (!checkArgs(paramArrayOfObject))
      return;
    if (this.mEventsHandler == null)
      this.mEventsHandler = new CalendarEventsHandler(paramMraidView.getContext(), this);
    CalendarEvent localCalendarEvent = (CalendarEvent)Utils.fromJson((String)paramArrayOfObject[0], CalendarEvent.class);
    this.mView = paramMraidView;
    if ((localCalendarEvent == null) || (localCalendarEvent.start == null) || (localCalendarEvent.description == null) || ("".equals(localCalendarEvent.description)))
    {
      errorOccured("Error parsing event. Check mandatory start and description fields.");
      return;
    }
    this.mEventsHandler.scheduleEvent(localCalendarEvent);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.component.networkcomponent.burstly.html.mraid.AddCalendarEvent
 * JD-Core Version:    0.6.2
 */